<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
        <meta content="telephone=no" name="format-detection" />
        <title>个人中心</title>
        <link href="{{asset('/mobile/css/style.css')}}" rel="stylesheet" type="text/css">
    </head>
    <style type="text/css">
        body{
            background-color: #F1F1F1;
        }
        input{
            border: none;
            outline: none;
        }
        .top-img{
            width: 100%;
        }
        .li{
            background-color: #FFFFFF;
            border-bottom: 1px solid #d0d0d0;
            padding: 15px 20px;
            display: flex;
            align-items: center;
        }
        .li-arrow{
            padding-right: 30px;
            position: relative;
        }
        .li-left{
            flex: 0 0 30%;
        }
        .li-right{
            flex: 0 0 70%;
            text-align: right;
        }
        .myinp{
            text-align: right;
            width: 100%;
        }
        .red{
            color: #D42400;
        }
        .btn-big{
            text-align: center;
            background-color: #D9543B;
            border-radius: 5px;
            font-size: 1.1rem;
            padding: 0.7rem 0;
            color: #F9EAE7;
            width: 90%;
            margin: 50px auto 0;
        }
        .icon_arrow{
            height: 0.9rem;
            position: absolute;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
            -webkit-transform: translateY(-50%);
        }
        
    </style>
    <body>
        <img class="top-img" src="{{asset('/imgs/top1.png')}}"/>
        @if(!$agent->id_card)
            <form action="/mobile/agent/person_add/{{$agent->id}}" method="POST">
                {{csrf_field()}}
                <div id="con1" class="list">
                    <div class="li">
                        <div class="li-left">真实姓名</div>
                        <div class="li-right">
                            <input class="myinp" type="text" id="name" name="realname" placeholder="请输入真实姓名" value="{{$agent->realname}}"/>
                        </div>
                    </div>
                    <div class="li">
                        <div class="li-left">身份证号码</div>
                        <div class="li-right">
                            <input class="myinp" type="text" maxlength="18" id="sfz" name="id_card" placeholder="请输入身份证号码" value="{{old('id_card')}}"/>
                        </div>
                    </div>
                    <div class="li">
                        <div class="li-left">QQ号码</div>
                        <div class="li-right">
                            <input class="myinp" type="text" maxlength="18" id="qq" name="qq" placeholder="请输入QQ号码" value="{{old('qq')}}"/>
                        </div>
                    </div>
                    <div class="li">
                        <div class="li-left">常用地址</div>
                        <div class="li-right">
                            <input class="myinp" type="text" id="address" name="address" placeholder="请输入常用地址" value="{{$agent->address}}" />
                        </div>
                    </div>
                    <div class="btn-big" id="go">确认提交</div>
                    <div style="text-align:center;font-weight:bold;font-size:13px">
                        <span id="err_msg" style="color:red;">
                            @if ($errors->any())          
                              {{ $errors->first() }}
                            @endif
                        </span>
                    </div>
                </div>
            </form>    
        @else
            <div id="con2">
                <div class="li">
                    <div class="li-left">真实姓名</div>
                    <div class="li-right">
                        <div>{{$agent->realname}}</div>
                    </div>
                </div>
                <div class="li">
                    <div class="li-left">身份证号码</div>
                    <div class="li-right">
                        <div>{{$agent->id_card}}</div>
                    </div>
                </div>
                <div class="li">
                    <div class="li-left">手机号码</div>
                    <div class="li-right">
                        <div>{{$agent->mobile}}</div>
                    </div>
                </div>
                <div class="li">
                    <div class="li-left">QQ号码</div>
                    <div class="li-right">
                        <div>{{$agent->qq}}</div>
                    </div>
                </div>
                <div class="li li-arrow" onclick="window.location.href='/mobile/agent/person_address/{{$agent->id}}'">
                    <div class="li-left">常用地址</div>
                    <div class="li-right">
                        <div>{{$agent->address}}</div>
                    </div>
                    <img class="icon_arrow" src="{{asset('/imgs/arrow.png')}}"/>
                </div>
            </div>
        @endif
    <script type="text/javascript" src="{{asset('/mobile/js/jquery-1.8.3.min.js')}}"></script>
    <script type="text/javascript" src="{{asset('/js/Inertia.js')}}"></script>
    <script type="text/javascript" src="{{asset('/js/backHome.js')}}"></script>
    <script type="text/javascript">

        // 修改地址
        $('.li-arrow').on('touchstart', function() {
            window.location.href = './centerAddress.html'
        })
        // 提交
        $('#go').on('touchstart', function() {
            $(this).parents('form').submit();
        })
    </script>
    </body>
</html>
